<template>
   <van-tabbar v-model="tabActive">
      <van-tabbar-item icon="home-o" to="/">首页</van-tabbar-item>
      <van-tabbar-item icon="friends-o" to='/users'>用户</van-tabbar-item>
      <van-tabbar-item icon="chart-trending-o">交易</van-tabbar-item>
      <van-tabbar-item icon="manager-o" >我的</van-tabbar-item>
    </van-tabbar>
</template>
<script>
export default {
    //   props:['tabActive'],
      data() {
            return {
                tabActive: 0
            }
        },
        mounted(){
            switch(this.$route.path){
                case "/users":
                    this.tabActive = 1;
                    break;
                case '/':
                    this.tabActive = 0;
                    break;
                default:
                    this.tabActive = 0;
            }
        },
}
</script>